<?php

namespace Acme\TestBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Lucky
 *
 * @ORM\Table(name="lucky")
 * @ORM\Entity(repositoryClass="Acme\TestBundle\Repository\LuckyRepository")
 */
class Lucky
{
    /**
     * @var int
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     * @ORM\Column(name="name",type="string",length=200,options={"comment"="标题"})
     */
    private $name;

    /**
     * @var int
     * @ORM\Column(name="number",type="integer",length=3,options={"comment"="幸运值"})
     */
    private $number;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="create_time", type="datetime", options={"default"="CURRENT_TIMESTAMP"})
     */
    private $createTime;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="update_time", type="datetime", options={"default"="CURRENT_TIMESTAMP"})
     */
    private $updateTime;

    public function __construct()
    {
        $this->createTime = new \DateTime();
        $this->updateTime = new \DateTime();
    }


    /**
     * Get id
     *
     * @return int
     */
    public function getId()
    {
        return $this->id;
    }

    public function setId($id)
    {
        $this->id = $id;
        return $this;
    }

    /**
     * Get name
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * set name
     * @param $name
     * @return $this
     */
    public function setName($name)
    {
        $this->name = $name;
        return $this;
    }

    /**
     * Get number
     * @return int
     */
    public function getNumber()
    {
        return $this->number;
    }

    /**
     * set number
     * @param $number
     * @return $this
     */
    public function setNumber($number)
    {
        $this->number = $number;
        return $this;
    }

    /**
     * get CreateTime
     * @return string
     */
    public function getCreateTime()
    {
        return $this->createTime->format('Y-m-d H:i:s');
    }

    /**
     * set createTime
     * @param $creteTime
     * @return $this
     */
    public function setCreateTime($creteTime)
    {
        $this->createTime = $creteTime;
        return $this;
    }

    /**
     * set updateTime
     * @param $updateTime
     * @return $this
     */
    public function setUpdateTime($updateTime){
        $this->updateTime = $updateTime;
        return $this;
    }

    /**
     * get UpdateTime
     * @return string
     */
    public  function  getUpdateTime(){
        return $this->updateTime->format('Y-m-d H:i:s');
    }
}
